import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getwidget/getwidget.dart';
import 'package:sz_metro/page/mine/settings/index.dart';

class MineContent extends StatefulWidget {
  const MineContent({Key? key}) : super(key: key);

  @override
  State<MineContent> createState() => _MineContentState();
}

class _MineContentState extends State<MineContent> {
  @override
  void initState() {
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: GFAppBar(
        backgroundColor: Colors.white,
        centerTitle: true,
        bottom: PreferredSize(
          preferredSize: const Size.fromHeight(100),
          child: Container(
            padding: const EdgeInsets.all(0.0),
            margin: const EdgeInsets.all(0.0),
            child: GFListTile(
              avatar: const GFAvatar(
                backgroundImage: AssetImage('assets/launcher/launcher.png'),
              ),
              title: const Text('未登录'),
              subTitle: GFButton(
                onPressed: () {},
                color: Theme.of(context).primaryColor,
                size: GFSize.SMALL,
                text: "去登录",
                padding: const EdgeInsets.all(0.0),
              ),
            ),
          ),
        ),
        actions: <Widget>[
          GFIconButton(
            icon: const Icon(
              Icons.settings,
              color: Colors.grey,
            ),
            onPressed: () {
              Get.to(()=>const SettingsContent());
            },
            type: GFButtonType.transparent,
          ),
        ],
      ),
      body: ListView(
        children: [
          GFCard(
            boxFit: BoxFit.cover,
            content: Row(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              children: const [
                Text("我的里程(km)"),
                Text("0"),
              ],
            ),
          ),
          GFCard(
            boxFit: BoxFit.cover,
            content: Row(
              mainAxisAlignment: MainAxisAlignment.spaceAround,
              children: const [
                Tab(
                  icon: Icon(Icons.record_voice_over),
                  child: Text(
                    '乘车记录',
                  ),
                ),
                Tab(
                  icon: Icon(Icons.airplane_ticket),
                  child: Text(
                    '乘车发票',
                  ),
                ),
                Tab(
                  icon: Icon(Icons.location_city),
                  child: Text(
                    '常用地址',
                  ),
                ),
                Tab(
                  icon: Icon(Icons.card_giftcard),
                  child: Text(
                    '电子卡包',
                  ),
                ),
              ],
            ),
          ),
          GFCard(
            boxFit: BoxFit.cover,
            content: Column(children: const [
              GFListTile(
                avatar: Icon(
                  Icons.favorite,
                  color: Colors.grey,
                ),
                icon: Icon(
                  Icons.arrow_right,
                  color: Colors.grey,
                ),
                title: Text('去好评'),
              ),
              Divider(
                height: 1,
                color: Colors.grey,
                indent: 25,
              ),
              GFListTile(
                avatar: Icon(
                  Icons.favorite,
                  color: Colors.grey,
                ),
                icon: Icon(
                  Icons.arrow_right,
                  color: Colors.grey,
                ),
                title: Text('投诉建议'),
              ),
              Divider(
                height: 1,
                color: Colors.grey,
                indent: 25,
              ),
              GFListTile(
                avatar: Icon(
                  Icons.favorite,
                  color: Colors.grey,
                ),
                icon: Icon(
                  Icons.arrow_right,
                  color: Colors.grey,
                ),
                title: Text('推荐深圳地铁App'),
              ),
            ]),
          ),
        ],
      ),
    );
  }
}
